package demo02;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class demo1 {
    public static void main(String[] args) throws IOException {
        //    循环读取数据
//        FileInputStream fileInputStream = new FileInputStream("testDir\\a.txt");
//        int b ;
//        while((b=fileInputStream.read())!=-1){
//            System.out.print((char) b);
//        }
//        fileInputStream.close();
        FileInputStream fileInputStream = new FileInputStream("testDir\\\\a.txt");
        int b;
//        read读取一个数据就移动一次指针
        while((b=fileInputStream.read())!=-1){
            System.out.print((char) b);
        }
        fileInputStream.close();
    }

}
